package com.neutech.factorial;

public class FibonacciTest {
    public static void main(String[] args) {
        System.out.println("第九个月后共有" + fibonacci(9) + "对");
    }

    public static int fibonacci(int n) {
        // F(0)=1,F(1)=1,F(n)=F(n-1)+F(n-2)   斐波那契数列
        if (n == 0 || n == 1) {
            return 1;
        }
        return fibonacci(n - 1) +fibonacci(n - 2);
    }
}
